Skip to content

Conversation

@jbusecke
Copy link
Collaborator

@jbusecke jbusecke commented Oct 8, 2025

Replacing #96 since we cannot deploy to sandbox from a fork.

Depends on #95 and developmentseed/titiler#1235

Tasks

@jbusecke
Copy link
Collaborator Author

jbusecke commented Oct 8, 2025

@jbusecke
Copy link
Collaborator Author

Just added auth for the RASI data and it immedately worked with titiler-multidim! RASI map

- name: Run tests
run: uv run pytest
run: uv run pytest -n auto
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added pytest-xdist mostly for more performant tests locally. Does not do much on a 2 core gh runner.

Remove installation of system dependencies for compilation.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should probably take those out?


authorize_virtual_chunk_access = authorize_virtual_chunk_access or {}

print(f"DEBUG: authorize_virtual_chunk_access = {authorize_virtual_chunk_access}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(f"DEBUG: authorize_virtual_chunk_access = {authorize_virtual_chunk_access}")

assert response.status_code == 200
assert response.json() == ds_params["variables"]
# TODO: Do we care about the order?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hrodmn just a flag here. I think we don't but let me know if I am missing anything here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the order matters!


[dependency-groups]
dev = [
"dask>=2025.9.1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was beneficial for generating the test fixtures, but happy to remove it if you think that I should.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to include it in the dev dependencies

@jbusecke
Copy link
Collaborator Author

@hrodmn this is ready for a review! Please ignore the tons of files in the test fixtures (sorry they clobber the diff quite a bit).

@hrodmn hrodmn self-requested a review November 12, 2025 18:39
Copy link
Contributor

@hrodmn hrodmn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is great - nice work @jbusecke! The only changes I request are to avoid using assertions for raising errors in the actual runtime code.

For context on the configuration and deployment, the value that we set for TITILER_MULTIDIM_AUTHORIZED_CHUNK_ACCESS will be added as a secret value in a SSM secret that gets shared by multiple applications in a given deploy environment, so we may only have to define it once per deployment environment even if multiple applications want to use the same values.

- name: Get relevant environment configuration from aws secrets
if: inputs.env_aws_secret_name != ''
shell: bash
working-directory: ${{ inputs.dir }}
env:
AWS_DEFAULT_REGION: us-west-2
run: |
if [[ -z "${{ inputs.script_path }}" ]]; then
./scripts/sync-env.sh ${{ inputs.env_aws_secret_name }}
else
python ${{ inputs.script_path }} --secret-id ${{ inputs.env_aws_secret_name }}
fi


[dependency-groups]
dev = [
"dask>=2025.9.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to include it in the dev dependencies

authorize_virtual_chunk_access: Optional[Dict[str, Dict[str, Any]]] = None,
) -> xr.Dataset:
"""Open an IceChunk dataset using xarray."""
assert icechunk is not None, "'icechunk' must be installed to read icechunk dataset"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside of tests I would raise actual exceptions (like ImportError in this case) instead of assert statements. If the application gets run in "optimized mode" the assert statements will be ignored!

) -> List[str]:
"""List available variable in a dataset."""
with xarray_open_dataset(
# todo: why is this not a method of the reader class? Seems like a smell that I have to define the opener here again....
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could add a XarrayReader.open_src method and use that in XarrayReader.__post_init__ and here so we could at least recycle the code.

assert response.status_code == 200
assert response.json() == ds_params["variables"]
# TODO: Do we care about the order?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the order matters!

@jbusecke
Copy link
Collaborator Author

Thanks so much for the review @hrodmn. Ill see if I can get this cleaned up and ready for Monday!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants